import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import './plugins/element.js'

// 配置请求基准地址(待补)
// axios.defaults.baseURI = ''
Vue.prototype.$axios = axios

// 自动化部署全局组件
const componentContext = require.context('./components', false, /Base[A-Z]\w*.vue$/)

componentContext.keys().forEach((fileName, index, arr) => {
  const componentName = arr[index].slice(2, -4)
  const componentConfig = componentContext(fileName).default
  Vue.component(componentName, componentConfig)
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
